|
|
|
|
|
|
|
A text box control is used to retrieve information from the user. Besides the label control, a text box is the tool youll use most often when designing a Windows application. Now you can add text boxes to the form next to the labels to collect the employee information. |
|
|
|
|
|
|
|
|
When adding text boxes to your form, try to draw them the same height as the labels. Also, make each box a size thats appropriate to the data youre trying to collect. For example, the Last Name text box should be slightly longer than the First Name text box. When you add text boxes to a form, the Text property will automatically be filled in with Textn. Some programmers set the Text property to the same value as the Name property, and some just set the Text property to a blank string. |
|
|
|
|
| Creating Text Boxes 1. Add text boxes to your form to make it look like Figure 3.4. 2. Create the text boxes with the properties set to the values shown in Table 3.4. | | Table 3.4 Text Boxes to Add to the Form. | | Name | MaxLength | | txtFirst | 20 | | txtLast | 25 | | txtAddress | 50 | | txtCity | 35 | | txtState | 2 | | txtZip | 10 | | txtPhone | 14 | | txtSSN | 11 | | | |
|
|
|